<template>
  <a-modal :bodyStyle="bodyStyle"
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :destroyOnClose="true"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <stepsTemplate   ref="steps" ></stepsTemplate>
    </a-spin>
  </a-modal>
</template>
<script>
  import { postSubmitReq,submitDealReq,getEnumData ,getRefSetOpenVal,getLoadPageUrlData} from '@/utils/auth'
    export default {
        name: "stepsModalTemplate",
        components: {
           stepsTemplate: () => import('./steps.vue')
        },
        computed: {
          isVisible: {
            get() {
              return this.dialogVisible
            },
            set() {
              //this.close()
             // this.reset()
            }
          }
        },
        mounted() {
          window.onresize = () => {
            return (() => {
              this.width = this.initWidth()
            })()
          }
        },
        data() {
          return {
            triggerOpenParam: {},
            bodyStyle:{padding: '0px'},
            dialogVisible:true,
            confirmLoading:false,
            screenWidth: 0,
            buttonLoading: false,
            buttonDisabled: false,
            width: this.initWidth(),
            title:"步骤操作",
            modalVisible:false,
            loading:false,
            selectType:'checkbox',
            //selectType:'radio',
            btnItem:null,
            formItem:null,
            disableSubmit:false,
            selectionRows:null,
            visible: false,
            record: null,
            pageUrlData:{S_PAGE_ID:'',S_PAGE_VER:''},
          }
      },
      methods: {
        initWidth () {
          this.screenWidth = document.body.clientWidth
          if (this.screenWidth < 991) {
            return '95%'
          } else if (this.screenWidth < 1400) {
            return '90%'
          } else {
            return '800px'
          }
        },
        showLoadGeneralModal (btnItem,refOpen,record) {
           console.log('steps ...showLoadGeneralModal...',refOpen);
          this.formItem = btnItem
          this.visible = true
          this.record = record
          /**
          let pageTempData = getLoadPageUrlData(refOpen,record)
          pageTempData.refOpen = refOpen
          if (null != pageTempData) {
             this.pageUrlData  = Object.assign({}, pageTempData)
          } else {
             this.$message('按钮响应界面URL地址未位置')
          }
           */
        },
        openTableMenuSelect(record){
          this.selectionRows = record
        },
        handleCancel() {
          this.visible = false;
        },
        handleOk() {
           // this.$emit('returnQuickSelectRows',this.selectionRows,this.formItem);
           this.visible = false;
           this.$emit('close')
        }
      }
    }
</script>
